<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=<s>, initial-scale=1.0">
    <title>Document</title>
</head>
<body>


    <script>
        var car = {
            color:'红色',
            name:'yema',
            money:10000,
            arr:[],
            obj:{},
            func:function(carColor,carName){
                console.log('车的颜色是'+carColor,'车的名字是'+carName)
                console.log('对象中的函数被执行了')
            }
        }
        console.log(car)
        // console.log(car.func)
        car.func(car.color,car.name)


         // 重复修改数组的同一内容，元素的结果是最后一次被覆盖内容
        // 重复修改对象的同一属性，只会强行创建一个属性，属性值为最后一次声明的数据
        var arr = []
        var obj = {}


        arr[0] = 1
        arr[0] = 2
        arr[0] = 3


        obj.a = 10
        obj.a = 20
        obj.a = 30

        console.log(arr)
        console.log(obj)
    </script>
</body>
</html>